<template>
  <div>
    <el-form ref="elForm" :model="formData" size="mini">
      <el-row style="border-bottom: 1px solid #f2f2f2">
        <el-col :span="5">
          <el-form-item label="检测类型" prop="sexCode" label-width="78px">
            <el-select
              v-model="itemName"
              placeholder="请选择下拉选择"
              clearable
              @change="marquee"
            >
              <el-option
                v-for="item in options4"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="计划类型" prop="sexCode" label-width="78px">
            <el-select
              v-model="value"
              placeholder="请选择下拉选择"
              clearable
              @change="selectedvalue(value)"
            >
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="添加计划" prop="sexCode" label-width="78px">
            <el-select
              v-model="planning"
              placeholder="请选择下拉选择"
              clearable
            >
              <el-option
                v-for="item in options1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="3" v-if="form_items_status">
          <el-form-item>
            <el-select
              v-model="medicineName"
              placeholder="请选择下拉选择"
              clearable
            >
              <el-option
                v-for="item in options2"
                :key="item.value2"
                :label="item.label"
                :value="item.value2"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="3" v-if="form_items_statuss">
          <el-form-item>
            <el-time-select
              v-model="detectionTime"
              :picker-options="{
                start: '00:00',
                step: '00:30',
                end: '24:00'
              }"
              placeholder="选择时间"
            >
            </el-time-select>
          </el-form-item>
        </el-col>
        <el-col :span="3" v-if="form_items_statusss">
          <el-form-item>
            <el-date-picker
              v-model="detectionTime"
              type="datetime"
              placeholder="选择日期时间"
              value-format="yyyy-MM-dd HH:mm:ss"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-button
          type="primary"
          style="margin-left: 100px;"
          @click="increase"
          >新 增</el-button
        >
        <div id="tableData">
          <el-table
            :data="tableData"
            style="width: 100%;margin-bottom: 20px;"
            border
          >
            <el-table-column prop="planning" label="星期" align="center" />
            <el-table-column
              prop="medicineName"
              label="饮食时间"
              align="center"
            />

            <el-table-column
              prop="detectionTime"
              label="时间"
              align="center"
            />

            <el-table-column label="操作" align="center" width="120">
              <template slot-scope="scope">
                <div>
                  <el-button
                    type="text"
                    @click="removethebaseline(scope.row.uuid)"
                    >删除</el-button
                  >
                </div>
                <!--  @click="removethebaseline(scope.row.id)" -->
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-row>
    </el-form>
    <div v-if="state == 2">
      <div style="color: #4380ea"><h3>立即检测</h3></div>
      <div>
        <el-radio-group v-model="radio" @change="switchthepage">
          <el-radio label="1">辅助监测</el-radio>
          <el-radio label="2">手动录入</el-radio>
        </el-radio-group>
      </div>
      <div v-if="form_items_statussss">
        <div class="category_title">
          <div class="shutiao"></div>
          <div>血压/BP</div>
        </div>

        <el-row
          style=" border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject11"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="5">
              <el-form-item label="收缩压" label-width="60px">
                <el-input
                  v-model="thedataobject11.systolic"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmHg</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="舒张压" label-width="60px">
                <el-input
                  v-model="thedataobject11.diastolic"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmHg</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="脉率值"
                label-width="60px"
                style="margin-left: 20px; "
              >
                <el-input
                  v-model="thedataobject11.heartRate"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">umol/L</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject11.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <div class="category_title">
          <div class="shutiao"></div>
          <div>血脂/TC</div>
        </div>
        <el-row
          style="height: 10px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject44"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item label="总胆固醇" label-width="78px">
                <el-input
                  v-model="thedataobject44.totalCholesterol"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmol/L</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="甘油三酯" label-width="78px">
                <el-input
                  v-model="thedataobject44.triglyceride"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmol/L</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="高密度脂蛋白" label-width="96px">
                <el-input
                  v-model="thedataobject44.hdl"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmol/L</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="低密度脂蛋白"
                label-width="96px"
                style="margin-left: 0px; "
              >
                <el-input
                  v-model="thedataobject44.ldl"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmol/L</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject44.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
                <!--<el-time-select
                  
                  :picker-options="{
                    start: '00:00',
                    step: '00:30',
                    end: '24:00'
                  }"
                  placeholder="选择时间"
                >
                </el-time-select>-->
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>

        <div class="category_title">
          <div class="shutiao"></div>
          <div>心电图/ECG</div>
        </div>
        <el-row
          style="height: 10px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject66"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item label="心率" label-width="60px">
                <el-input
                  v-model="thedataobject66.heartRate"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">bpm</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="结论"
                label-width="60px"
                style="margin-left: 0px; "
              >
                <el-select
                  v-model="thedataobject66.result"
                  placeholder="请选择"
                  clearable
                >
                  <el-option
                    v-for="item in options6"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject66.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <div class="category_title">
          <div class="shutiao"></div>
          <div>血糖/Glu</div>
        </div>
        <el-row
          style="height: 15px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject22"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item label="血糖类型">
                <el-select
                  v-model="thedataobject22.choose"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <el-option
                    v-for="(item, index) in options7"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                    :disabled="item.disabled"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="血糖" label-width="60px">
                <el-input
                  v-model="thedataobject22.sugarValue"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">mmol/L</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject22.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>

        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>

        <div class="category_title">
          <div class="shutiao"></div>
          <div>糖化血红蛋白/HbA1c</div>
        </div>
        <el-row
          style="height: 15px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject33"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item
                label="糖化血红蛋白"
                label-width="96px"
                style="margin-left: 20px; "
              >
                <el-input
                  v-model="thedataobject33.ghbValue"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">%</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject33.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>

        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>

        <div class="category_title">
          <div class="shutiao"></div>
          <div>血尿酸/UA</div>
        </div>
        <el-row
          style="height: 10px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject55"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item label="血尿酸" label-width="60px">
                <el-input
                  v-model="thedataobject55.bloodUricAcid"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">%</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject55.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>

        <div class="category_title">
          <div class="shutiao"></div>
          <div>同型半胱氨酸/Hcy</div>
        </div>
        <el-row
          style="height: 10px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject88"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item label="同型半胱氨酸" label-width="98px">
                <el-input
                  v-model="thedataobject88.homocySteineAcid"
                  placeholder="请输入单行文本血糖"
                  clearable
                  :style="{ width: '100%' }"
                >
                  <template slot="append">%</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject88.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>

        <div class="category_title">
          <div class="shutiao"></div>
          <div>血氧/SpO2</div>
        </div>
        <el-row
          style="height: 10px; border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
        <el-row :gutter="20">
          <el-form
            ref="elForm"
            :model="thedataobject77"
            size="mini"
            label-width="78px"
            label-position="left"
            style="margin-top: 15px; "
          >
            <el-col :span="6">
              <el-form-item label="检测时间">
                <el-date-picker
                  v-model="thedataobject77.testTime"
                  style="width: 180px"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
        <el-row
          style="border-bottom: 1px solid #f2f2f2"
          type="flex"
          class="row-bg"
        >
        </el-row>
      </div>

      <div v-if="form_items_statusssss">
        <el-form ref="elForm" :model="formData" size="mini">
          <el-row style="border-bottom: 1px solid #f2f2f2">
            <el-col :span="8">
              <el-form-item label="检测类型" prop="sexCode" label-width="78px">
                <el-select
                  v-model="itemNames"
                  placeholder="请选择下拉选择"
                  clearable
                  @change="marquees"
                >
                  <el-option
                    v-for="item in options5"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>

        <div v-if="immediatedetectiondisplay1">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>血压/BP</div>
          </div>

          <el-row
            style=" border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="bloodPressures.bloodPressures"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="5">
                <el-form-item label="收缩压" label-width="60px">
                  <el-input
                    v-model="bloodPressures.bloodPressures.systolic"
                    
                    onkeyup="value=value.replace(/[^\d^\.]+/g,'')"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmHg</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="舒张压" label-width="60px">
                  <el-input
                    v-model="bloodPressures.bloodPressures.diastolic"
                    
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmHg</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item
                  label="脉率值"
                  label-width="60px"
                  style="margin-left: 10px; "
                >
                  <el-input
                    v-model="bloodPressures.bloodPressures.heartRate"
                    
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">umol/L</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="5">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="bloodPressures.bloodPressures.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay2">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>血糖/Glu</div>
          </div>
          <el-row
            style="height: 15px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="bloodSugars.bloodSugars"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="血糖类型">
                  <el-select
                    v-model="bloodSugars.bloodSugars.choose"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <el-option
                      v-for="(item, index) in options7"
                      :key="index"
                      :label="item.label"
                      :value="item.value"
                      :disabled="item.disabled"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="血糖" label-width="60px">
                  <el-input
                    v-model="bloodSugars.bloodSugars.sugarValue"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmol/L</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="bloodSugars.bloodSugars.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay3">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>糖化血红蛋白/HbA1c</div>
          </div>
          <el-row
            style="height: 15px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="glycosylatedHb.glycosylatedHb"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="糖化血红蛋白" label-width="98px">
                  <el-input
                    v-model="glycosylatedHb.glycosylatedHb.totalCholesterol"
                    
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">#</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="glycosylatedHb.glycosylatedHb.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>

          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay4">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>血脂/TC</div>
          </div>
          <el-row
            style="height: 10px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="bloodFats.bloodFats"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="总胆固醇" label-width="78px">
                  <el-input
                    v-model="bloodFats.bloodFats.totalCholesterol"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmol/L</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="甘油三酯" label-width="78px">
                  <el-input
                    v-model="bloodFats.bloodFats.triglyceride"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmol/L</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="高密度脂蛋白" label-width="96px">
                  <el-input
                    v-model="bloodFats.bloodFats.hdl"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmol/L</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item
                  label="低密度脂蛋白"
                  label-width="96px"
                  style="margin-left: 0px; "
                >
                  <el-input
                    v-model="bloodFats.bloodFats.ldl"
                    
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">mmol/L</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="5">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="bloodFats.bloodFats.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay6">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>心电图/ECG</div>
          </div>
          <el-row
            style="height: 10px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="electrocardios.electrocardios"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="心率" label-width="60px">
                  <el-input
                    v-model="electrocardios.electrocardios.heartRate"
                    @change="aaaaaa"
                    onkeyup="value=value.replace(/[^\d]/g,'')"
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">bpm</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item
                  label="结论"
                  label-width="60px"
                  style="margin-left: 0px; "
                >
                  <el-select
                    v-model="electrocardios.electrocardios.result"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in options6"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="5">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="electrocardios.electrocardios.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay5">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>血尿酸/UA</div>
          </div>
          <el-row
            style="height: 10px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="bloodUrines.bloodUrines"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="血尿酸" label-width="60px">
                  <el-input
                    v-model="bloodUrines.bloodUrines.bloodUricAcid"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">%</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="bloodUrines.bloodUrines.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay7">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>血氧/SpO2</div>
          </div>
          <el-row
            style="height: 10px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="bloodOxygens.bloodOxygens"
              size="mini"
              label-width="78px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="血氧" label-width="60px">
                  <el-input
                    v-model="bloodOxygens.bloodOxygens.oxygen"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">%</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="脉率" label-width="60px">
                  <el-input
                    v-model="bloodOxygens.bloodOxygens.pulseRate"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">bmp</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay8">
          <div class="category_title">
            <div class="shutiao"></div>
            <div>同型半胱氨酸/Hcy</div>
          </div>
          <el-row
            style="height: 10px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <el-row :gutter="20">
            <el-form
              ref="elForm"
              :model="homocySteines.homocySteines"
              size="mini"
              label-width="98px"
              label-position="left"
              style="margin-top: 15px; "
            >
              <el-col :span="6">
                <el-form-item label="同型半胱氨酸" label-width="98px">
                  <el-input
                    v-model="homocySteines.homocySteines.homocySteineAcid"
                    
                    placeholder="请输入单行文本血糖"
                    clearable
                    :style="{ width: '100%' }"
                  >
                    <template slot="append">%</template>
                  </el-input>
                </el-form-item>
              </el-col>
                <el-col :span="6">
                <el-form-item label="检测时间">
                  <el-date-picker
                    v-model="homocySteines.homocySteines.testTime"
                    style="width: 180px"
                    type="datetime"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd HH:mm:ss"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row
            style="border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
        </div>
        <div v-if="immediatedetectiondisplay66">
          <span>心电图文件（请上传文件）</span>
          <!--<el-button type="primary" @click="getfile()">上传</el-button>-->
          <input
            ref="file"
            type="file"
            name="files"
            class="upload_input"
            style="display:none"
            accept="image/*"
            value="点击上传"
            @change="onUpload($event)"
            multiple
          />

          <el-row
            style="height: 15px; border-bottom: 1px solid #f2f2f2"
            type="flex"
            class="row-bg"
          >
          </el-row>
          <!-- 弹窗 新增 start -->
          <!-- 图片区 start -->
          <div class="source">
            <div>
              <ul class="el-upload-list el-upload-list--picture-card">
                <li
                  v-for="(item, index) in files"
                  :key="index"
                  class="el-upload-list__item"
                >
                  <img
                    :src="item.src"
                    alt=""
                    class="el-upload-list__item-thumbnail"
                  /><span class="el-upload-list__item-actions"
                    ><span
                      class="el-upload-list__item-preview"
                      @click="item_preview(item.src)"
                      ><i class="el-icon-zoom-in"></i></span
                    ><span
                      class="el-upload-list__item-delete"
                      @click="removeFile(index)"
                      ><i class="el-icon-delete"></i></span
                  ></span>
                </li>
              </ul>
              <div class="el-upload el-upload--picture-card">
                <i class="el-icon-plus"></i
                ><input
                  type="file"
                  name="files"
                  accept="image/*"
                  value="点击上传"
                  class="upload_input"
                  @change="onUpload($event)"
                  multiple
                />
              </div>
            </div>
          </div>
          <!-- 图片区 end -->

          <!-- 预览弹窗 start  -->
          <el-dialog :visible.sync="dialogVisible" append-to-body>
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </div>

        <el-button
          type="primary"
          @click="savethedata"
          style="width: 180px; display: block; margin: 0 auto; margin-top: 20px"
          >保 存
        </el-button>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState } from "vuex";//引入
import { newdetectioninformation } from "@/api/follow-up/follow-up-records"; //新增检查信息
import { shownewdetection } from "@/api/follow-up/follow-up-records"; //显示新增检查信息
import { deleteshownewdetection } from "@/api/follow-up/follow-up-records"; //删除检查信息
import { valuerange } from "@/api/follow-up/follow-up-records"; //取值范围接口
import { echothemeasureddata } from "@/api/follow-up/follow-up-records"; //回显数据
import { thenewmeasure } from "@/api/follow-up/follow-up-records"; //新增测量
import { upload } from "@/api/follow-up/follow-up-records"; //上传图片
import { removeFiles } from "@/api/follow-up/follow-up-records"; //上传图片
import { signal } from "codemirror";
export default {
  name: "testing-planning",

  components: {},
  props: ["patId","state"],
  data() {
    return {
      radio: "1",
      uuid: null,
      options: [
        {
          value: "餐饮时间",
          label: "餐饮时间"
        },
        {
          value: "24小时制",
          label: "24小时制"
        },
        {
          value: "时间",
          label: "时间"
        }
      ],

      options1: [
        {
          value: "星期一",
          label: "星期一"
        },
        {
          value: "星期二",
          label: "星期二"
        },
        {
          value: "星期三",
          label: "星期三"
        },
        {
          value: "星期四",
          label: "星期四"
        },
        {
          value: "星期五",
          label: "星期五"
        },
        {
          value: "星期六",
          label: "星期六"
        },
        {
          value: "星期天",
          label: "星期天"
        }
      ],
      options2: [
        {
          value2: "晨起",
          label: "晨起"
        },
        {
          value2: "早餐前",
          label: "早餐前"
        },
        {
          value2: "早餐中",
          label: "早餐中"
        },
        {
          value2: "早餐后",
          label: "早餐后"
        },
        {
          value2: "早餐后两小时",
          label: "早餐后两小时"
        },
        {
          value2: "午餐前",
          label: "午餐前"
        },
        {
          value2: "午餐中",
          label: "午餐中"
        },
        {
          value2: "午餐后",
          label: "午餐后"
        },
        {
          value2: "午餐后两小时",
          label: "午餐后两小时"
        },
        {
          value2: "晚餐前",
          label: "晚餐前"
        },
        {
          value2: "晚餐中",
          label: "晚餐中"
        },
        {
          value2: "晚餐后",
          label: "晚餐后"
        },
        {
          value2: "晚餐后两小时",
          label: "晚餐后两小时"
        },
        {
          value2: "睡前",
          label: "睡前"
        }
      ],
      options4: [
        {
          value: "血压/BP",
          label: "血压/BP"
        },
        {
          value: "血糖/Glu",
          label: "血糖/Glu"
        },
        {
          value: "糖化血红蛋白/HbA1c",
          label: "糖化血红蛋白/HbA1c"
        },
        {
          value: "血脂/TC",
          label: "血脂/TC"
        },
        {
          value: "血尿酸/UA",
          label: "血尿酸/UA"
        },
        {
          value: "心电图/ECG",
          label: "心电图/ECG"
        },
        {
          value: "血氧/SpO2",
          label: "血氧/SpO2"
        },
        {
          value: "同型半胱氨酸/Hcy",
          label: "同型半胱氨酸/Hcy"
        }
      ],
      options5: [
        {
          value: "血压/BP",
          label: "血压/BP"
        },
        {
          value: "血糖/Glu",
          label: "血糖/Glu"
        },
        {
          value: "糖化血红蛋白/HbA1c",
          label: "糖化血红蛋白/HbA1c"
        },
        {
          value: "血脂/TC",
          label: "血脂/TC"
        },
        {
          value: "血尿酸/UA",
          label: "血尿酸/UA"
        },
        {
          value: "心电图/ECG",
          label: "心电图/ECG"
        },
        {
          value: "血氧/SpO2",
          label: "血氧/SpO2"
        },
        {
          value: "同型半胱氨酸/Hcy",
          label: "同型半胱氨酸/Hcy"
        }
      ],
      options6: [
        {
          value: "正常",
          label: "正常"
        },
        {
          value: "异常",
          label: "异常"
        }
      ],
      options7: [
        {
          value: "1",
          label: "空腹"
        },
        {
          value: "2",
          label: "早餐前"
        },
        {
          value: "3",
          label: "早餐后"
        },
        {
          value: "4",
          label: "午餐前"
        },
        {
          value: "5",
          label: "午餐后"
        },
        {
          value: "6",
          label: "晚餐前"
        },
        {
          value: "7",
          label: "晚餐后"
        },
        {
          value: "8",
          label: "睡前"
        }
      ],
      value: "",
      planning: "", //添加计划
      medicineName: "", //饭后
      detectionTime: "", //时间
      itemName: "血压/BP", //检测类型
      itemNames: "血压/BP",
      patientId: this.patId,
      form_items_status: true,
      form_items1: false,
      form_items2: false,
      form_items3: true,
      form_items_statuss: false,
      form_items_statusss: false,
      form_items_statussss: true,
      form_items_statusssss: false,
      dialogImageUrl: "",
      dialogVisible: false,
      dialogFormVisible: false,
      immediatedetectiondisplay1: true, //立即检测显示血压
      immediatedetectiondisplay2: false, //立即检测显示血糖
      immediatedetectiondisplay3: false, //立即检测显示糖化血红蛋白
      immediatedetectiondisplay4: false, //立即检测显示血脂
      immediatedetectiondisplay5: false, //立即检测显示血尿酸
      immediatedetectiondisplay6: false, //立即检测显示心电
      immediatedetectiondisplay66: false, //立即检测显示心电
      immediatedetectiondisplay7: false, //立即血氧
      immediatedetectiondisplay8: false, //同型半胱氨酸
      tolddoctorId: this.$store.getters.userId, //登录人id
      tolddoctorName: this.$store.getters.name, //登录人姓名
      tableData: [],
      //血压对象
      bloodPressures: {
        bloodPressures: {
          diastolic: "", //舒张压
          systolic: "", //收缩压值
          heartRate: "", //脉率值
          cloudMemberId: this.patId, //患者ID
          // cloudMemberId: "20201201092510886", //患者ID
          testTime: "", //检测时间
          deviceCode: "Manual",
          diastolicAbnormal: "", //舒张压值是否正常 0正常 1偏低 2偏高
          systolicUnit: "mmHg", //舒张压单位
          diastolicUnit: "mmHg", //舒张压单位
          heartRateAbnormal: "", //脉率值是否正常 0正常 1偏低 2偏高
          leftRight: "1", //1左臂 2右臂
          systolicAbnormal: "", //收缩压值是否正常 0正常 1偏低 2偏高
          sourceTypeCode: "3" //1患者使用设备测量 2医生使用设备测量 3医生手动录入
        },
        cloudMemberId: this.patId //患者ID
      },
      //血糖对象
      bloodSugars: {
        bloodSugars: {
          choose: "", //类型
          sugarValue: "", //血糖值
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          sourceTypeCode: "3", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          sugarValueAbnormal: "0", //血糖值是否正常 0正常 1偏低 2偏高
          sugarValueUnit: "mmol/L", // 血糖值单位
          testTime: ""
        },
        cloudMemberId: this.patId //患者ID
      },
      //糖化血红蛋白对象
      glycosylatedHb: {
        glycosylatedHb: {
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          ghbValue: "", //糖化血红蛋白
          ghbValueAbnormal: "", // 糖化血红蛋白值是否正常 0正常 1偏低 2偏高
          id: this.uuid,
          ghbValueUnit: "%", //糖化血红蛋白值单位
          sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          testTime: "" //检测时间
        },
        cloudMemberId: this.patId //患者ID
      },
      //血脂对象
      bloodFats: {
        bloodFats: {
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          totalCholesterol: "", //总胆固醇
          totalCholesterolAbnormal: "", //总胆固醇是否正常 0正常 1偏低 2偏高
          totalCholesterolUnit: "mmol/L", // 总胆固醇单位
          hdl: "", //高密度脂蛋白
          hdlAbnormal: "", //高密度脂蛋白是否正常 0正常 1偏低 2偏高
          hdlUnit: "mmol/L", //高密度脂蛋白单位
          triglyceride: "", //甘油三酯
          triglycerideAbnormal: "", //甘油三酯是否正常 0正常 1偏低 2偏高
          triglycerideUnit: "mmol/L", //甘油三酯单位
          id: this.uuid,
          ldlAbnormal: "", //低密度脂蛋白是否正常 0正常 1偏低 2偏高
          sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          ldl: "", //低密度脂蛋白
          testTime: "" //检测时间
        },
        cloudMemberId: this.patId //患者ID
      },
      //血尿酸对象
      bloodUrines: {
        bloodUrines: {
          bloodUricAcid: "", // 血尿酸值
          bloodUricAcidAbnormal: "", //血尿酸值是否正常 0正常 1偏低 2偏高
          bloodUricAcidUnit: "%", // 血尿酸值单位
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          id: this.uuid,
          sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          testTime: "" //检测时间
        },
        cloudMemberId: this.patId //患者ID
      },
      //心电对象
      electrocardios: {
        electrocardios: {
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          id: this.uuid,
          heartRate: "", //心率
          heartRateAbnormal: "", //心率是否正常 0正常 1偏低 2偏高
          result: "", //结论
          sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          testTime: "", //检测时间
          fileId: []
        },
        cloudMemberId: this.patId //患者ID
      },
      //fileId:"",
      files1: [],

      //血氧对象
      bloodOxygens: {
        bloodOxygens: {
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          id: this.uuid,
          oxygen: "", //血氧
          oxygenAbnormal: "", //血氧是否正常 0正常 1偏低 2偏高
          oxygenUnit: "%", //血氧单位
          result: "", //结论
          pulseRate: "", //脉率
          pulseRateAbnormal: "", //脉率是否正常 0正常 1偏低 2偏高
          pulseRateUnit: "bmp", //脉率
          sourceTypeCode: "3", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          testTime: "" //检测时间
        },
        cloudMemberId: this.patId //患者ID
      },
      //同型半胱氨酸对象
      homocySteines: {
        homocySteines: {
          cloudMemberId: this.patId, //患者ID
          deviceCode: "Manual",
          id: this.uuid,
          homocySteineAcid: "", //同型半胱氨酸
          homocySteineAcidAbnormal: "", //同型半胱氨酸是否正常 0正常 1偏低 2偏高
          homocySteineUnit: "", //同型半胱氨酸单位
          sourceTypeCode: "3", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
          testTime: "" //检测时间
        },
        cloudMemberId: this.patId //患者ID
      },
      //回显
      //血压对象
      thedataobject11: {
        diastolic: "", //舒张压
        systolic: "", //收缩压值
        heartRate: "", //脉率值
        cloudMemberId: this.patientId, //患者ID
        testTime: "", //检测时间
        deviceCode: "Manual",
        diastolicAbnormal: "", //舒张压值是否正常 0正常 1偏低 2偏高
        diastolicUnit: "mmhg", //舒张压单位
        heartRateAbnormal: "", //脉率值是否正常 0正常 1偏低 2偏高
        //id: this.uuid,
        eftRight: "1", //1左臂 2右臂
        systolicAbnormal: "", //收缩压值是否正常 0正常 1偏低 2偏高
        sourceTypeCode: "1" //1患者使用设备测量 2医生使用设备测量 3医生手动录入
      },
      //血糖对象
      thedataobject22: {
        choose: "", //类型
        sugarValue: "", //血糖值
        cloudMemberId: this.patientId, //患者ID
        deviceCode: "Manual",
        sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
        sugarValueAbnormal: "0", //血糖值是否正常 0正常 1偏低 2偏高
        sugarValueUnit: "mmol/L" // 血糖值单位
      },
      //糖化血红蛋白对象
      thedataobject33: {
        cloudMemberId: this.patientId, //患者ID
        deviceCode: "Manual",
        ghbValue: "", //糖化血红蛋白
        ghbValueAbnormal: "", // 糖化血红蛋白值是否正常 0正常 1偏低 2偏高
        id: this.uuid,
        ghbValueUnit: "%", //糖化血红蛋白值单位
        sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
        testTime: "" //检测时间
      },
      //血脂对象
      thedataobject44: {
        cloudMemberId: this.patientId, //患者ID
        deviceCode: "Manual",
        totalCholesterol: "", //总胆固醇
        totalCholesterolAbnormal: "", //总胆固醇是否正常 0正常 1偏低 2偏高
        totalCholesterolUnit: "mmol/L", // 总胆固醇单位
        hdl: "", //高密度脂蛋白
        hdlAbnormal: "", //高密度脂蛋白是否正常 0正常 1偏低 2偏高
        hdlUnit: "mmol/L", //高密度脂蛋白单位
        triglyceride: "", //甘油三酯
        triglycerideAbnormal: "", //甘油三酯是否正常 0正常 1偏低 2偏高
        triglycerideUnit: "mmol/L", //甘油三酯单位
        id: this.uuid,
        ldlAbnormal: "", //低密度脂蛋白是否正常 0正常 1偏低 2偏高
        sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
        ldl: "", //低密度脂蛋白
        testTime: "" //检测时间
      },
      //血尿酸对象
      thedataobject55: {
        bloodUricAcid: "", // 血尿酸值
        bloodUricAcidAbnormal: "", //血尿酸值是否正常 0正常 1偏低 2偏高
        bloodUricAcidUnit: "%", // 血尿酸值单位
        cloudMemberId: this.patientId, //患者ID
        deviceCode: "Manual",
        id: this.uuid,
        sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
        testTime: "" //检测时间
      },
      //心电对象
      thedataobject66: {
        cloudMemberId: this.patientId, //患者ID
        deviceCode: "Manual",
        id: this.uuid,
        heartRate: "", //心率
        heartRateAbnormal: "", //心率是否正常 0正常 1偏低 2偏高
        result: "", //结论
        sourceTypeCode: "1", //1患者使用设备测量 2医生使用设备测量 3医生手动录入
        testTime: "" //检测时间
      },
      //血氧对象
      thedataobject77: {
        id: this.uuid,
        testTime: "" //检测时间
      },
      //同型半胱氨酸对象
      thedataobject88: {
        id: this.uuid,
        homocySteineAcid: "", //
        homocySteineUnit: "%",
        testTime: "" //检测时间
      },
      downValue1: "", //血脂总胆固醇
      upValue1: "",
      downValue2: "", //血脂甘油三酯
      upValue2: "",
      downValue3: "", //血脂高密度脂蛋白
      upValue3: "",
      downValue4: "", //血脂低密度脂蛋白
      upValue4: "",
      downValue5: "", //血氧
      upValue5: "",
      downValue6: "", //收缩压
      upValue6: "",
      downValue7: "", //舒张压
      upValue7: "",
      downValue8: "", //血糖(餐前)
      upValue8: "",
      downValue9: "", //血糖(餐后)
      upValue9: "",
      downValue10: "", //血尿酸
      upValue10: "",
      downValue11: "", //糖化血红蛋白
      upValue11: "",
      downValue12: "", //心率
      upValue12: "",
      downValue13: "", //同型半胱氨酸
      upValue13: "",
      dialogFormVisible: false,
      formData: {},
      formInline: {},
      activeName: "1",
      files: [],
      index: ""
    };
  },
  computed: {
    /**
    * 哪页取值，就写到哪页
    */
    ...mapState({
      tagsView: (state) => state.tagsView.addButtonState,
    })
  },
  created() {},
  mounted() {
    this.state = sessionStorage.getItem('state');
    this.initSelectCategorys();
    
    this.marquee();
    this.valuerange();
    if(this.patId==""){
      this.initSelectCategoryss();
    }
  },
  methods: {
    //新增检测信息
    increase() {
      if (this.idss == "餐饮时间") {
        if (
          this.value == "" ||
          this.itemName == "" ||
          this.planning == "" ||
          this.medicineName == ""
        ) {
          this.$message.error("验证不得为空");
        } else {
          let params = [
            {
              amount: -1.0,
              itemName: this.itemName,
              medicineName: this.medicineName,
              orderType: "1",
              patientId: this.patientId,
              planning: this.planning,
              single: -1.0,
              tolddoctorId: this.tolddoctorId,
              tolddoctorName: this.tolddoctorName,
              detectionTime: this.detectionTime,
              id: this.patId
            }
          ];
          newdetectioninformation(params).then(res => {
            this.initSelectCategorys();

            (this.value = ""),
              (this.planning = ""),
              (this.medicineName = ""),
              (this.detectionTime = ""),
              this.$message({
                message: "添加成功",
                type: "success"
              });
          });
        }
      } else if (this.idss == "24小时制" || this.idss == "时间") {
        if (
          this.value == "" ||
          this.itemName == "" ||
          this.planning == "" ||
          this.detectionTime == ""
        ) {
          this.$message.error("验证不得为空");
        } else {
          let params = [
            {
              amount: -1.0,
              itemName: this.itemName,
              medicineName: this.medicineName,
              orderType: "1",
              patientId: this.patientId,
              planning: this.planning,
              single: -1.0,
              tolddoctorId: this.tolddoctorId,
              tolddoctorName: this.tolddoctorName,
              detectionTime: this.detectionTime,
              id: this.patId
            }
          ];
          newdetectioninformation(params).then(res => {
            this.initSelectCategorys();

            (this.value = ""),
              (this.planning = ""),
              (this.medicineName = ""),
              (this.detectionTime = ""),
              this.$message({
                message: "添加成功",
                type: "success"
              });
          });
        }
      } else if (
        this.value == "" ||
        this.itemName == "" ||
        this.planning == "" ||
        this.medicineName == ""
      ) {
        this.$message.error("验证不得为空");
      }
    },
    //显示
    initSelectCategorys() {
      let params = {
        amount: -1.0,
        itemName: this.itemName,
        medicineName: this.medicineName,
        patientId: this.patId,
        single: -1.0
      };
      shownewdetection(params).then(res => {
        this.tableData = res;
        console.log("回显了");
      });
    },

    aaaaaa: function(e) {
      console.log(typeof e, "e");
    },

    //切换
    selectedvalue: function(id) {
      this.idss = id;
      if (id == "餐饮时间") {
        this.form_items_status = true;
        this.form_items_statuss = false;
        this.form_items_statusss = false;
        this.form_items1 = false;
        this.form_items2 = false;
        this.form_items3 = true;
      } else if (id == "24小时制") {
        this.form_items_status = false;
        this.form_items_statuss = false;
        this.form_items_statusss = true;

        this.form_items1 = true;
        this.form_items2 = false;
        this.form_items3 = false;
        this.detectionTime = "";
      } else if (id == "时间") {
        this.form_items_status = false;
        this.form_items_statuss = true;
        this.form_items_statusss = false;
        this.form_items1 = false;
        this.form_items2 = true;
        this.form_items3 = false;
        this.detectionTime = "";
      }
      console.log(this.idss, "id哈哈哈");
    },
    //保存数据
     savethedata() {
      if (this.itemNames == "血压/BP") {
        this.downValue7 = Number(this.downValue7);
        this.upValue7 = Number(this.upValue7);
        this.bloodPressures.bloodPressures.diastolic = Number(
          this.bloodPressures.bloodPressures.diastolic
        );
        if (
          this.downValue7 <= this.bloodPressures.bloodPressures.diastolic &&
          this.bloodPressures.bloodPressures.diastolic <= this.upValue7
        ) {
          this.bloodPressures.bloodPressures.diastolicAbnormal = 0;
        } else if (
          this.bloodPressures.bloodPressures.diastolic < this.downValue7
        ) {
          this.bloodPressures.bloodPressures.diastolicAbnormal = 1;
        } else if (
          this.bloodPressures.bloodPressures.diastolic > this.upValue7
        ) {
          this.bloodPressures.bloodPressures.diastolicAbnormal = 2;
        }
        this.downValue6 = Number(this.downValue6);
        this.upValue6 = Number(this.upValue6);
        this.bloodPressures.bloodPressures.systolic = Number(
          this.bloodPressures.bloodPressures.systolic
        );

        if (
          this.downValue6 <= this.bloodPressures.bloodPressures.systolic &&
          this.bloodPressures.bloodPressures.systolic <= this.upValue6
        ) {
          this.bloodPressures.bloodPressures.systolicAbnormal = 0;
        } else if (
          this.bloodPressures.bloodPressures.systolic < this.downValue6
        ) {
          this.bloodPressures.bloodPressures.systolicAbnormal = 1;
        } else if (
          this.bloodPressures.bloodPressures.systolic > this.upValue6
        ) {
          this.bloodPressures.bloodPressures.systolicAbnormal = 2;
        }
        this.downValue12 = Number(this.downValue12);
        this.upValue12 = Number(this.upValue12);
        this.bloodPressures.bloodPressures.heartRate = Number(
          this.bloodPressures.bloodPressures.heartRate
        );
        if (
          this.downValue12 < this.bloodPressures.bloodPressures.heartRate &&
          this.bloodPressures.bloodPressures.heartRate < this.upValue12
        ) {
          this.bloodPressures.bloodPressures.heartRateAbnormal = 0;
        } else if (
          this.bloodPressures.bloodPressures.heartRate < this.downValue12
        ) {
          this.bloodPressures.bloodPressures.heartRateAbnormal = 1;
        } else if (
          this.bloodPressures.bloodPressures.heartRate > this.upValue12
        ) {
          this.bloodPressures.bloodPressures.heartRateAbnormal = 2;
        }

        let params = this.bloodPressures;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      } else if (this.itemNames == "血糖/Glu") {
        console.log(this.itemNames, "血糖");

        if (
          this.bloodSugars.bloodSugars.choose == "1" ||
          this.bloodSugars.bloodSugars.choose == "2" ||
          this.bloodSugars.bloodSugars.choose == "4" ||
          this.bloodSugars.bloodSugars.choose == "6"
        ) {
          this.downValue8 = Number(this.downValue8);
          this.upValue8 = Number(this.upValue8);
          this.bloodSugars.bloodSugars.sugarValue = Number(
            this.bloodSugars.bloodSugars.sugarValue
          );
          if (
            this.downValue8 < this.bloodSugars.bloodSugars.sugarValue &&
            this.bloodSugars.bloodSugars.sugarValue < this.upValue8
          ) {
            this.bloodSugars.bloodSugars.sugarValueAbnormal = 0;
          } else if (
            this.bloodSugars.bloodSugars.sugarValue < this.downValue8
          ) {
            this.bloodSugars.bloodSugars.sugarValueAbnormal = 1;
          } else if (this.bloodSugars.bloodSugars.sugarValue > this.upValue8) {
            this.bloodSugars.bloodSugars.sugarValueAbnormal = 2;
          }
            let params = this.bloodSugars;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
        } else if (
          this.bloodSugars.bloodSugars.choose == "3" ||
          this.bloodSugars.bloodSugars.choose == "5" ||
          this.bloodSugars.bloodSugars.choose == "7" ||
          this.bloodSugars.bloodSugars.choose == "8"
        ) {
          this.downValue9 = Number(this.downValue9);
          this.upValue9 = Number(this.upValue9);
          this.bloodSugars.bloodSugars.sugarValue = Number(
            this.bloodSugars.bloodSugars.sugarValue
          );
          if (
            this.downValue9 < this.bloodSugars.bloodSugars.sugarValue &&
            this.bloodSugars.bloodSugars.sugarValue < this.upValue9
          ) {
            this.bloodSugars.bloodSugars.sugarValueAbnormal = 0;
          } else if (
            this.bloodSugars.bloodSugars.sugarValue < this.downValue9
          ) {
            this.bloodPressures.bloodPressures.sugarValueAbnormal = 1;
          } else if (this.bloodSugars.bloodSugars.sugarValue > this.upValue9) {
            this.bloodSugars.bloodSugars.sugarValueAbnormal = 2;
          }
            let params = this.bloodSugars;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
        }

      
      } else if (this.itemNames == "糖化血红蛋白/HbA1c") {
        console.log(this.itemNames, "糖化血红蛋白");
        this.downValue11 = Number(this.downValue11);
        this.upValue11 = Number(this.upValue11);
        this.glycosylatedHb.glycosylatedHb.ghbValue = Number(
          this.glycosylatedHb.glycosylatedHb.ghbValue
        );
        if (
          this.downValue11 < this.glycosylatedHb.glycosylatedHb.ghbValue &&
          this.glycosylatedHb.glycosylatedHb.ghbValue < this.upValue11
        ) {
          this.glycosylatedHb.glycosylatedHb.ghbValueAbnormal = 0;
        } else if (
          this.glycosylatedHb.glycosylatedHb.ghbValue < this.downValue11
        ) {
          this.glycosylatedHb.glycosylatedHb.ghbValueAbnormal = 1;
        } else if (
          this.glycosylatedHb.glycosylatedHb.ghbValue > this.upValue11
        ) {
          this.glycosylatedHb.glycosylatedHb.ghbValueAbnormal = 2;
        }
        let params = this.glycosylatedHb;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      } else if (this.itemNames == "血脂/TC") {
        console.log(this.itemNames, "血脂");
        this.downValue1 = Number(this.downValue1);
        this.upValue1 = Number(this.upValue1);
        this.bloodFats.bloodFats.totalCholesterol = Number(
          this.bloodFats.bloodFats.totalCholesterol
        );
        if (
          this.downValue1 < this.bloodFats.bloodFats.totalCholesterol &&
          this.bloodFats.bloodFats.totalCholesterol < this.upValue1
        ) {
          this.bloodFats.bloodFats.totalCholesterolAbnormal = 0;
        } else if (
          this.bloodFats.bloodFats.totalCholesterol < this.downValue1
        ) {
          this.bloodFats.bloodFats.totalCholesterolAbnormal = 1;
        } else if (this.bloodFats.bloodFats.totalCholesterol > this.upValue1) {
          this.bloodFats.bloodFats.totalCholesterolAbnormal = 2;
        }
        this.downValue2 = Number(this.downValue2);
        this.upValue2 = Number(this.upValue2);
        this.bloodFats.bloodFats.triglyceride = Number(
          this.bloodFats.bloodFats.triglyceride
        );
        if (
          this.downValue2 < this.bloodFats.bloodFats.triglyceride &&
          this.bloodFats.bloodFats.triglyceride < this.upValue2
        ) {
          this.bloodFats.bloodFats.triglycerideAbnormal = 0;
        } else if (this.bloodFats.bloodFats.triglyceride < this.downValue2) {
          this.bloodFats.bloodFats.triglycerideAbnormal = 1;
        } else if (this.bloodFats.bloodFats.triglyceride > this.upValue2) {
          this.bloodFats.bloodFats.triglycerideAbnormal = 2;
        }
        this.downValue3 = Number(this.downValue3);
        this.upValue3 = Number(this.upValue3);
        this.bloodFats.bloodFats.hdl = Number(this.bloodFats.bloodFats.hdl);
        if (
          this.downValue3 <= this.bloodFats.bloodFats.hdl &&
          this.bloodFats.bloodFats.hdl < this.upValue3
        ) {
          this.bloodFats.bloodFats.hdlAbnormal = 0;
        } else if (this.bloodFats.bloodFats.hdl <= this.downValue3) {
          this.bloodFats.bloodFats.hdlAbnormal = 1;
        } else if (this.bloodFats.bloodFats.hdl >= this.upValue3) {
          this.bloodFats.bloodFats.hdlAbnormal = 2;
        }
        this.downValue4 = Number(this.downValue4);
        this.upValue4 = Number(this.upValue4);
        this.bloodFats.bloodFats.ldl = Number(this.bloodFats.bloodFats.ldl);
        if (
          this.downValue4 < this.bloodFats.bloodFats.ldl &&
          this.bloodFats.bloodFats.ldl < this.upValue4
        ) {
          this.bloodFats.bloodFats.ldlAbnormal = 0;
        } else if (this.bloodFats.bloodFats.ldl < this.downValue4) {
          this.bloodFats.bloodFats.ldlAbnormal = 1;
        } else if (this.bloodFats.bloodFats.ldl > this.upValue4) {
          this.bloodFats.bloodFats.ldlAbnormal = 2;
        }
        let params = this.bloodFats;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      } else if (this.itemNames == "血尿酸/UA") {
        console.log(this.itemNames, "血尿酸");
        this.downValue10 = Number(this.downValue10);
        this.upValue10 = Number(this.upValue10);
        this.bloodUrines.bloodUrines.bloodUricAcid = Number(
          this.bloodUrines.bloodUrines.bloodUricAcid
        );
        if (
          this.downValue10 <= this.bloodUrines.bloodUrines.bloodUricAcid &&
          this.bloodUrines.bloodUrines.bloodUricAcid <= this.upValue10
        ) {
          this.bloodUrines.bloodUrines.bloodUricAcidAbnormal = 0;
        } else if (
          this.bloodUrines.bloodUrines.bloodUricAcid < this.downValue10
        ) {
          this.bloodUrines.bloodUrines.bloodUricAcidAbnormal = 1;
        } else if (
          this.bloodUrines.bloodUrines.bloodUricAcid > this.upValue10
        ) {
          this.bloodUrines.bloodUrines.bloodUricAcidAbnormal = 2;
        }
        let params = this.bloodUrines;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      } else if (this.itemNames == "血氧/SpO2") {
        this.downValue5 = Number(this.downValue5);
        this.upValue5 = Number(this.upValue5);
        this.bloodOxygens.bloodOxygens.oxygen = Number(
          this.bloodOxygens.bloodOxygens.oxygen
        );
        console.log(this.itemNames, "心电");
        if (
          this.downValue5 < this.bloodOxygens.bloodOxygens.oxygen &&
          this.bloodOxygens.bloodOxygens.oxygen < this.upValue5
        ) {
          this.bloodOxygens.bloodOxygens.oxygenAbnormal = 0;
        } else if (this.bloodOxygens.bloodOxygens.oxygen < this.downValue5) {
          this.bloodOxygens.bloodOxygens.oxygenAbnormal = 1;
        } else if (this.bloodOxygens.bloodOxygens.oxygen > this.upValue5) {
          this.bloodOxygens.bloodOxygens.oxygenAbnormal = 2;
        }
        this.downValue11 = Number(this.downValue11);
        this.upValue11 = Number(this.upValue11);
        this.bloodOxygens.bloodOxygens.pulseRate = Number(
          this.bloodOxygens.bloodOxygens.pulseRate
        );
        if (
          this.downValue11 < this.bloodOxygens.bloodOxygens.pulseRate &&
          this.bloodOxygens.bloodOxygens.pulseRate < this.upValue11
        ) {
          this.bloodOxygens.bloodOxygens.pulseRateAbnormal = 0;
        } else if (
          this.bloodOxygens.bloodOxygens.pulseRate < this.downValue11
        ) {
          this.bloodOxygens.bloodOxygens.pulseRateAbnormal = 1;
        } else if (this.bloodOxygens.bloodOxygens.pulseRate > this.upValue11) {
          this.bloodOxygens.bloodOxygens.pulseRateAbnormal = 2;
        }
        let params = this.bloodOxygens;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      } else if (this.itemNames == "同型半胱氨酸/Hcy") {
        console.log(this.itemNames, "心电");
        this.downValue13= Number(this.downValue13);
        this.upValue13= Number(this.upValue13);
        this.homocySteines.homocySteines.homocySteineAcid = Number(
          this.homocySteines.homocySteines.homocySteineAcid
        );
        if (
          this.downValue13 <=
            this.homocySteines.homocySteines.homocySteineAcid &&
          this.homocySteines.homocySteines.homocySteineAcid <= this.upValue13
        ) {
          this.homocySteines.homocySteines.homocySteineAcidAbnormal = 0;
        } else if (
          this.homocySteines.homocySteines.homocySteineAcid < this.downValue13
        ) {
          this.homocySteines.homocySteines.homocySteineAcidAbnormal = 1;
        } else if (
          this.homocySteines.homocySteines.homocySteineAcid > this.upValue13
        ) {
          this.homocySteines.homocySteines.homocySteineAcidAbnormal = 2;
        }
        let params = this.homocySteines;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      } else if (this.itemNames == "心电图/ECG") {
        console.log(this.itemNames, "心电");

        this.downValue12 = Number(this.downValue12);
        this.upValue12 = Number(this.upValue12);
        this.electrocardios.electrocardios.heartRate = Number(
          this.electrocardios.electrocardios.heartRate
        );

        if (
          this.downValue12 <= this.electrocardios.electrocardios.heartRate &&
          this.electrocardios.electrocardios.heartRate <= this.upValue12
        ) {
          this.electrocardios.electrocardios.heartRateAbnormal = 0;
        } else if (
          this.electrocardios.electrocardios.heartRate < this.downValue12
        ) {
          this.electrocardios.electrocardios.heartRateAbnormal = 1;
        } else if (
          this.electrocardios.electrocardios.heartRate > this.upValue12
        ) {
          this.electrocardios.electrocardios.heartRateAbnormal = 2;
        }

        let params = this.electrocardios;
        thenewmeasure(params).then(res => {
          this.$message({
            message: "保存成功",
            type: "success"
          });
        });
      }
    },
    //删除
    removethebaseline(uuid) {
      let params = { uuid: uuid };
      deleteshownewdetection(params).then(res => {
        this.initSelectCategorys();
        this.$message({
          message: "删除成功",
          type: "success"
        });
      });
    },
    //取值范围
    valuerange() {
      //  let params = { inpatientId: "20201030152544206" };
      valuerange().then(res => {
        this.downValue1 = res.data[1].down;
        this.upValue1 = res.data[1].up;
        this.downValue2 = res.data[2].down;
        this.upValue2 = res.data[2].up;
        this.downValue3 = res.data[3].down;
        this.upValue3 = res.data[3].up;
        this.downValue4 = res.data[4].down;
        this.upValue4 = res.data[4].up;
        this.downValue5 = res.data[5].down;
        this.upValue5 = res.data[5].up;
        this.downValue6 = res.data[6].down;
        this.upValue6 = res.data[6].up;
        this.downValue7 = res.data[7].down;
        this.upValue7 = res.data[7].up;
        this.downValue8 = res.data[8].down;
        this.upValue8 = res.data[8].up;
        this.downValue9 = res.data[9].down;
        this.upValue9 = res.data[9].up;
        this.downValue10 = res.data[10].down;
        this.upValue10 = res.data[10].up;
        this.downValue11 = res.data[11].down;
        this.upValue11 = res.data[11].up;
        this.downValue12 = res.data[12].down;
        this.upValue12 = res.data[12].up;
        this.downValue13 = res.data[13].down;
        this.upValue13 = res.data[13].up;
      });
    },
    //根据检测类型显示数据
    marquee(e) {
      this.initSelectCategorys();
    },
   //下拉选显示不同的保存对象
    marquees(e) {
      if (e == "血压/BP") {
        this.immediatedetectiondisplay1 = true;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = false;
      } else if (e == "血糖/Glu") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = true;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = false;
      } else if (e == "糖化血红蛋白/HbA1c") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = true;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = false;
      } else if (e == "血脂/TC") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = true;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = false;
      } else if (e == "血尿酸/UA") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = true;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = false;
      } else if (e == "心电图/ECG") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = true;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = true;
      } else if (e == "血氧/SpO2") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = true;
        this.immediatedetectiondisplay8 = false;
        this.immediatedetectiondisplay66 = false;
      } else if (e == "同型半胱氨酸/Hcy") {
        this.immediatedetectiondisplay1 = false;
        this.immediatedetectiondisplay2 = false;
        this.immediatedetectiondisplay3 = false;
        this.immediatedetectiondisplay4 = false;
        this.immediatedetectiondisplay5 = false;
        this.immediatedetectiondisplay6 = false;
        this.immediatedetectiondisplay7 = false;
        this.immediatedetectiondisplay8 = true;
        this.immediatedetectiondisplay66 = false;
      }
    },
    //切换页
    switchthepage: function(val) {
      if (val == 1) {
        this.form_items_statussss = true;
        this.form_items_statusssss = false;
      } else if (val == 2) {
        this.form_items_statussss = false;
        this.form_items_statusssss = true;
      }
    },
    //显示
    initSelectCategoryss(id) {
      let params = { cloudMemberId: this.patId };
      /* let params = { cloudMemberId: "20200508175357228" }; */
      echothemeasureddata(params).then(res => {
        if (res.code == 0) {
          this.thedataobject11 = res.data.bloodPressures;
          this.thedataobject22 = res.data.bloodSugars;
          this.thedataobject33 = res.data.glycosylatedHb;
          this.thedataobject44 = res.data.bloodFats;
          this.thedataobject55 = res.data.bloodUrines;
          this.thedataobject66 = res.data.electrocardios;
          this.thedataobject77 = res.data.bloodOxygens;
          this.thedataobject88 = res.data.homocySteines;
        }
      });
    },
    //上传按钮
    // getfile() {
    //   this.$refs.file.click();
    // },
    /**
     * 上传 图片集合 新增
     */
    async onUpload(e) {
      let that = this;
      let files = e.target.files;
      let createId = this.createId;
      let formdata = new FormData();
      let _arr = [];

      for (let file of files) {
        formdata.set("files", file);

        _arr.push({
          name: file.name,
          src: URL.createObjectURL(file),
          feedback: that.handleFile(formdata)
        });
      }
      this.files = this.files.concat(_arr);

      e.target.value = "";
    },

    //放大图片
    item_preview(src) {
      this.dialogImageUrl = src;
      this.dialogVisible = true;
    },
    //删除图片
    removeFile(index) {
      this.files.splice(index, 1);
      let b = this.electrocardios.electrocardios.fileId;

      removeFiles(b).then(res => {
        this.$message({
          message: "删除成功",
          type: "success"
        });
      });
    },
    clearnumber(value) {
      value = value + ".0";
      this.bloodPressures.bloodPressures.systolic = value;
      console.log(this.bloodPressures.bloodPressures.systolic, "value");
    },
    getCity(e) {
      console.log(e, "e");
      if (!/(^[1-9]\d*$)/.test(e)) {
        console.log("不是整数");
      } else {
        this.$message({
          message: "请精确到小数点，否则会保存失败",
          type: "warning"
        });
      }
    },
    /**
     * 后台处理单个图片
     */
    async handleFile(formdata) {
      let result = "";
      let fileId = "";
      let code = 0;

      let b = {
        //createId: this.$store.getters.userId,
        cloudMemberId: this.patId
      };

      await upload(formdata, b)
        .then(res => {
          result = res.data[0];
          fileId = result.fileId;
          code = 1;
          this.files1 = res.data[0].fileId;

          // console.log("xxxxx", this.thedataobject6.fileId);
          this.electrocardios.electrocardios.fileId.push(this.files1);
        })
        .catch(err => {
          code = 2;
        });

      return {
        code: code,
        fileId: fileId
      };
    }
    // removeItem(e) {
    //   e.stopPropagation();
    // },
    // handleRemove(file, fileList) {
    //   console.log(file);
    //   console.log(1, fileList);
    // },
    // handlePictureCardPreview(file) {
    //   this.dialogImageUrl = file.url;
    //   this.dialogVisible = true;
    // },
    // beforeRemove(file, fileList) {
    //   return this.$confirm(`确定移除 ${file.name}？`);
    // },
    // changed(file, fileList) {
    //   console.log(file);
    //   console.log(2, fileList);
    // }
  }
};
</script>

<style lang="scss" scoped>
.category_title {
  display: flex;
  align-items: center;

  margin-top: 10px;
  margin-left: 20px;
}
.shutiao {
  display: inline-block;
  width: 5px;
  height: 20px;
  border-radius: 28%;
  background-color: #4380ea;
  vertical-align: middle;
  margin-right: 6px;
}
.button {
  display: flex;
  margin-left: auto;
}

.shutiao {
  display: inline-block;
  width: 5px;
  height: 20px;
  border-radius: 28%;
  background-color: #4380ea;
  vertical-align: middle;
  margin-right: 6px;
}
.hospital_title {
  color: #4380ea;
}
// .category_title {
//   margin-bottom: 20px;
//   display: flex;
//   align-items: center;
//   justify-content: space-between;
//   .shutiao {
//     display: inline-block;
//     width: 5px;
//     height: 20px;
//     border-radius: 28%;
//     background-color: #4380ea;
//     vertical-align: middle;
//     margin-right: 6px;
//   }
// }

.remove {
  position: absolute;
  right: 0;
}
i.el-collapse-item__arrow {
  display: block;
  margin-right: 1000px;
}

.el-upload--picture-card {
  position: relative;
  overflow: hidden;
  .upload_input {
    display: block !important;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    opacity: 0;
    cursor: pointer;
  }
}
</style>








